home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!not-for-mail
- From: mobergru@oslonett.no (Rune Moberg)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Date: 15 Jan 1996 15:41:24 +0100
- Organization: CD-Player Pro author!
- Message-ID: <Eul+w0JfFyQD089yn@oslonett.no>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com>
- <fRA+w0JfFG5X089yn@oslonett.no> <4dcc4d$6anc@tigger.cc.uic.edu>
- NNTP-Posting-Host: hasle.sn.no
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
-
- In article <4dcc4d$6anc@tigger.cc.uic.edu>,
- olczyk@sunphy1 (Thadeus Olczyk) wrote:
- >As long as Delphi supports the toxic combination static typing and
- >single inheritance , people will not be able to use polymorphism
- >to replace case statements which will always make Delphi slower in any
- >large application.
-
- Ok. Further down you question my ability to read. Well, I know I can
- read, but I'm not sure we've read the same stuff... Thus we still argue.
-
- Anyway, in Bjarne's book about C++, which I haven't actually read, I just
- looked up "polymorphism", and Bjarne says (this can take a while, I
- type slow, since my keyboard has a sticky n-key):
- "Pointers to functions can be used to provide polymorphic routines, that
- is routines that can be applied to objects of many different types:
-
- typedef int (*CFT) (void*,void*);
-
- void sort(void* base, unsigned n, unsigned int sz, CFT cmp)"
-
- (don't worry, the n-key wasn't sticky after all, so typing went ahead
- at full speed. Bjarne mentions MI a couple of places (4), but not as
- a requirement for polymorphism)
-
- Now, I have some C experience (half a year), but the above is totally
- unreadable to me (the function header). Anyway, the concept is familiar;
- you have a function (or preferably a method) who accept an object as a
- parameter.
-
- The method can access that object's public properties, methods, whatever,
- provided the object descends from a known base object that the function
- knows about (i.e. the function assumes that the object reference passed
- has a method named e.g. "mymethod" which is inherited by all it's children)
-
- So far, this is very possible in Object Pascal, and a concept heavily
- used by Delphi. When you put a component on a form, you can attach event
- handlers. The parameter of an event handler is "Sender" of type TObject,
- thus I can share the same event handler among different components,
- and use typecasting whenever I need to reference something specific to
- a child object.
- thus:
- (Sender as TEdit).CutToClipboard;
- will work for TEdit and all descendants of TEdit, but will generate an
- exception for any other object.
-
- Object Pascal has a different type cast (also available in Delphi) that
- instead of generating an exception will most probably crash (AFAIK):
- TEdit(Sender).CutToClipboard; {a somewhat more direct approach}
-
- (Yes, the Object Pascal standard lacks certain new features specific
- to Delphi, but this might change due to Delphi's popularity. I believe
- we'll probably see Delphi for other platforms within two years. I'm not
- depending on this, all I want is a NT version)
-
- >Let's. RAD has recently come into disfavor in publications like JOOP, Object,
- >and even Byte. Last summer InfoWorld reported a growing disillusionment
-
- Borland has a couple of big customers that have shared their success
- stories with the public. Remember, Delphi isn't even a year old, so the
- publications you've mentioned aren't really uptodate. I even emailed a guy
- who wrote a piece for Byte last year (about RAD, summer issue), and he
- thought Delphi was ok. RAD so far has meant VB. Delphi is not VB. Granted,
- it's simple to use, but it's powerful at the same time.
-
- >I would like to see how you justify a claim of ease of mainenance when Delphi
- >does not support MI. Implication-- under some circumstances one cannot abstract
- >out common behavior and therefor must cut and paste code-- ie-- they must copy bugs. Everyone I know agrees that that causes a maintenace nightmare.
-
- Your claim. No copying of code is done here.
-
- The component library makes it easy to maintain a library of components,
- thus enhancing reuse and OOP.
-
- >readable. I should also say that I have never met a C/C++ programmer who had
- >trouble reading well-written C/C++. Poorly written C/C++ is another matter,
-
- Well, I had Turbo C at school (half a year), and got a nice grade (1.5
- on a scale from 1 to 6, 1 top) after exams were done, but I find it very
- difficult to read C code and C++ is thus impossible. Pascal is much
- more readable and easier to learn.
-
- >I've never seen much difference, except to say that in the case of RAD tools
- >you get a lot of people who only think they are programmers writing a lot of
- >crappy code.
-
- I have no statistics on this, but I won't argue with you, just want to
- mention that there are a lot of competent Delphi people around, just
- check out the various Delphi www sites and look at the freeware components
- out there. Serious work has been done and is done in Delphi, and it's
- usually done pretty fast (compared to traditional tools). We Delphians
- might not get the upper hand in these discussions, but atleast we get
- our apps out the door faster! :-)
-
- >: Seems strange, coming from someone who just wanted to compare VC"++" with
- >: Delphi...? VC++ 2.0 (and MFC) has been rejected by some C++ diehards, because
- >: it wasn't OO... (I assume they fixed this in 4.0?)
- >Duh. Can you read? The
- >original post said that you can't compare Delphi to MSVC++ or Object Pascal
- >to C++, that you have to compare C++ to Delphi. I claimed otherwise. Comparing
- >Delphi to VC++ ( or Borland C++ or Symantec C++) is entirely consistent with
- >my position.
-
- VC++'s MFC library doesn't make much use of inheritance at all, does it?
- Atleast that's what I've been told from someone residing in one of the
- C++ newsgroup (maybe it was a troll, but I've heard it elsewhere as well,
- MFC is supposedly bad OOP)?
-
- Anyway we gotta straighten out the mess at the top of this message before
- it's any point to venture deeper into this discussion.
-
- Take care.
-
- --
- =\
- *=- R.Moberg, CD-Player Pro info @ http://www.sn.no/~mobergru/
- =/
-